<<<<<<< .mine
<?php
header('Content-Type:text/html;charset=utf-8');
$MM="0";
@$a=$_GET['zzid'];
@$b=$_GET['cpdid'];

$PDO=new PDO('mysql:dbname=diancan;charset=UTF8;','root');
$dd=$PDO->prepare('select * from order1');
$dd->execute() ;
$DD=$dd->fetchAll(PDO::FETCH_NAMED);
foreach ($DD as $o => $ord) {
		if ($ord['canzhuoID']==$a) {
			$MM="1";	
			break;
		}
	}
$sj=$PDO->prepare('select now()');
$sj->execute() ;
$SJSJ=$sj->fetchAll(PDO::FETCH_NAMED);
#var_dump($SJSJ);
$c=$SJSJ[0]['now()'];
#echo $c;


if (empty($DD)) {
$czdd=$PDO->prepare('insert into order1(canzhuoID,ddscsj) values(:aa,:bb)');
$czdd->execute(array('aa'=>$a,'bb'=>$c));
$ddd=$PDO->prepare('select * from order1 where canzhuoID=:aa');
$ddd->execute(array('aa'=>$a)) ;
$DDD=$ddd->fetchAll(PDO::FETCH_NAMED);
$QWE=$DDD[0]['ID'];
$chdd=$PDO->prepare('insert into VTorder1(VTID,order1ID) values(:aa,:bb)');
$chdd->execute(array('aa'=>$b,'bb'=>$QWE));
}elseif ($MM==1){
	$ddd=$PDO->prepare('select * from order1 where canzhuoID=:aa');
	$ddd->execute(array('aa'=>$a)) ;
	$DDD=$ddd->fetchAll(PDO::FETCH_NAMED);
	$QWE=$DDD[0]['ID'];
	$chdd=$PDO->prepare('insert into VTorder1(VTID,order1ID) values(:aa,:bb)');
	$chdd->execute(array('aa'=>$b,'bb'=>$QWE));
}else{									
	$czdd=$PDO->prepare('insert into order1(canzhuoID,ddscsj) values(:aa,:bb)');
	$czdd->execute(array('aa'=>$a,'bb'=>$c));
	$ddd=$PDO->prepare('select * from order1 where canzhuoID=:aa');
	$ddd->execute(array('aa'=>$a)) ;
	$DDD=$ddd->fetchAll(PDO::FETCH_NAMED);
	$QWE=$DDD[0]['ID'];
	$chdd=$PDO->prepare('insert into VTorder1(VTID,order1ID) values(:aa,:bb)');
	$chdd->execute(array('aa'=>$b,'bb'=>$QWE));
}

header('Location:diancan.php?zzid='.$a);
	
?>||||||| .r7
=======
<?php
header('Content-Type:text/html;charset=utf-8');
$MM="0";
@$a=$_GET['zzid'];
@$b=$_GET['cpdid'];

$PDO=new PDO('mysql:dbname=diancan;charset=UTF8;','root');
$dd=$PDO->prepare('select * from order1');
$dd->execute() ;
$DD=$dd->fetchAll(PDO::FETCH_NAMED);
foreach ($DD as $o => $ord) {
		if ($ord['canzhuoID']==$a) {
			$MM="1";	
			break;
		}
	}

if($b!=0){
	if (empty($DD)) {
	$czdd=$PDO->prepare('insert into order1(canzhuoID) values(:aa)');
	$czdd->execute(array('aa'=>$a));
	$ddd=$PDO->prepare('select * from order1 where canzhuoID=:aa');
	$ddd->execute(array('aa'=>$a)) ;
	$DDD=$ddd->fetchAll(PDO::FETCH_NAMED);
	$QWE=$DDD[0]['ID'];
	$chdd=$PDO->prepare('insert into VTorder1(VTID,order1ID) values(:aa,:bb)');
	$chdd->execute(array('aa'=>$b,'bb'=>$QWE));
	}elseif ($MM==1){
		$ddd=$PDO->prepare('select * from order1 where canzhuoID=:aa');
		$ddd->execute(array('aa'=>$a)) ;
		$DDD=$ddd->fetchAll(PDO::FETCH_NAMED);
		$QWE=$DDD[0]['ID'];
		$chdd=$PDO->prepare('insert into VTorder1(VTID,order1ID) values(:aa,:bb)');
		$chdd->execute(array('aa'=>$b,'bb'=>$QWE));
	}else{									
		$czdd=$PDO->prepare('insert into order1(canzhuoID) values(:aa)');
		$czdd->execute(array('aa'=>$a));
		$ddd=$PDO->prepare('select * from order1 where canzhuoID=:aa');
		$ddd->execute(array('aa'=>$a)) ;
		$DDD=$ddd->fetchAll(PDO::FETCH_NAMED);
		$QWE=$DDD[0]['ID'];
		$chdd=$PDO->prepare('insert into VTorder1(VTID,order1ID) values(:aa,:bb)');
		$chdd->execute(array('aa'=>$b,'bb'=>$QWE));
	}
}
header('Location:diancan.php?zzid='.$a);
	
?>>>>>>>> .r8
